home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -in_the_mag- / reader_requests / mpmorph4x / install < prev    next >
Text File  |  1999-12-01  |  14KB  |  761 lines

  1. ; MPMorph - Amiga Morphing program
  2. ; Copyright (C) © 1993-96 Mark John Paddock
  3.  
  4. ; This program is free software; you can redistribute it and/or modify
  5. ; it under the terms of the GNU General Public License as published by
  6. ; the Free Software Foundation; either version 2 of the License, or
  7. ; any later version.
  8.  
  9. ; This program is distributed in the hope that it will be useful,
  10. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ; GNU General Public License for more details.
  13.  
  14. ; You should have received a copy of the GNU General Public License
  15. ; along with this program; if not, write to the Free Software
  16. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. ; mpaddock@cix.compulink.co.uk
  19.  
  20. ; This is the script to install MPMorph
  21. ; $VER: MPMorph-Install 4.8 (14.3.97)
  22.  
  23. (complete 1)
  24.  
  25. ; determine if in place or new drawer install
  26. (Set #InPlace
  27.     (askchoice
  28.         (prompt "Where do you want to install?\n\n"
  29.                 "If you have unpacked MPMorph 4.8 directly to the place you "
  30.                 "wish to run it from then select 'In Place', otherwise select 'New Drawer' "
  31.                 "to copy the relevant files to a new drawer")
  32.         (help @askchoice-help)
  33.         (choices "New Drawer" "In Place")
  34.         (default 1)
  35.     )
  36. )
  37.  
  38. (complete 2)
  39.  
  40. ; Ask for destination if not in place
  41. (if (NOT #InPlace)
  42.     (set #InstallDir
  43.         (askdir
  44.             (prompt "Where do you want to install MPMorph 4.8\n\n"
  45.                     "A new drawer named 'MPMorph' will be created in the "
  46.                     "selected directory and the MPMorph files copied there")
  47.             (help @askprompt-help)
  48.             (default "Work:")
  49.         )
  50.     )
  51. )
  52.  
  53. (complete 3)
  54.  
  55. ;Check where to install libraries
  56. (Set #LibChoice
  57.     (askchoice
  58.         (prompt "Where do you want to install the libraries?\n\n"
  59.             "You can choose to install the libraries required by MPMorph "
  60.             "in the MPMorph directory, "
  61.             "your LIBS: directory, or some other directory.")
  62.         (help @askchoice-help)
  63.         (choices "In Place" "LIBS:" "Elsewhere")
  64.         (default 1)
  65.     )
  66. )
  67.  
  68. (complete 4)
  69.  
  70. (if (= #LibChoice 2)
  71.     (Set #LibDir
  72.         (askdir
  73.             (prompt "Select directory in which to install the MPMorph libraries")
  74.             (help @askdir-help)
  75.             (default "LIBS:")
  76.         )
  77.     )
  78. )
  79.  
  80. (complete 5)
  81.  
  82. ; Set up directory names
  83. (if #InPlace
  84.     (Set #DestDir (expandpath ""))
  85. )
  86. (if (NOT #InPlace)
  87.     (Set #DestDir 
  88.           (tackon #InstallDir "MPMorph")
  89.     )
  90. )
  91. (if (= #libchoice 0)
  92.     (Set #LibDir #DestDir)
  93. )
  94. (if (= #libchoice 1)
  95.     (Set #LibDir "LIBS:")
  96. )
  97. (set #GuiDir
  98.     (tackon #DestDir "Gui")
  99. )
  100. (set #IncludeDir
  101.     (tackon #DestDir "include")
  102. )
  103. (Set #RexxDir 
  104.     (tackon #DestDir "Rexx")
  105. )
  106. (Set #CursorDir 
  107.     (tackon #DestDir "Cursor")
  108. )
  109. (Set #BrushDir 
  110.     (tackon #DestDir "Brush")
  111. )
  112. (Set #TutDir 
  113.     (tackon #DestDir "Tutorial")
  114. )
  115. (Set #HTMLDir 
  116.     (tackon #DestDir "HTML")
  117. )
  118. (Set #DocsDir
  119.     (tackon #DestDir "Docs")
  120. )
  121. (set @default-dest 
  122.     #DestDir
  123. )
  124.  
  125. ; Determine machine config
  126. (Set #Has020
  127.     (=
  128.         (database "cpu")
  129.         68020
  130.     )
  131. )
  132. (Set #Has030
  133.     (=
  134.         (database "cpu")
  135.         68030
  136.     )
  137. )
  138. (Set #Has040
  139.     (= 
  140.         (database "cpu")
  141.         68040
  142.     )
  143. )
  144. (Set #Has060
  145.     (= 
  146.         (database "cpu")
  147.         68060
  148.     )
  149. )
  150. (Set #HasFPU
  151.     (<>
  152.         (database "fpu")
  153.         "NOFPU"
  154.     )
  155. )
  156.  
  157. (Set #CPU 0)
  158. (if #Has020
  159.     (Set #CPU 1)
  160. )
  161. (if #Has030
  162.     (Set #CPU 1)
  163. )
  164. (if (AND #Has020 #HasFPU)
  165.     (Set #CPU 2)
  166. )
  167. (if (AND #Has030 #HasFPU)
  168.     (Set #CPU 2)
  169. )
  170. (if (AND #Has040 #HasFPU)
  171.     (Set #CPU 3)
  172. )
  173. (if #Has060
  174.     (Set #CPU 4)
  175. )
  176.  
  177. ; Check choice of program to install
  178. (set #CPU
  179.     (askchoice
  180.         (prompt "Install which version?")
  181.         (help "There are five versions of the MPRender program. "
  182.                 "The first requires just a 68000. "
  183.                 "The second requires a 68020. "
  184.                 "The third requires both a 68020 or 68030 CPU with a 68881 or 68882 FPU. "
  185.                 "The fourth requires a 68040. "
  186.                 "The last requires a 68080.\n\n"
  187.                 @askchoice-help)
  188.         (choices
  189.             "68000"
  190.             "68020"
  191.             "68020/030/68881/2"
  192.             "68040"
  193.             "68060"
  194.         )
  195.         (default #CPU)
  196.     )
  197. )
  198.  
  199. (if (= #CPU 4)
  200.     (
  201.     (Set #SrcImage "libs/MPImage.library.060")
  202.     (Set #SrcRender "MPRender.060")
  203.     (Set #Spatch 1)
  204.     (Set #ImagePatch "libs/MPImage.library.881")
  205.     (Set #RenderPatch "MPRender.881")
  206.     )
  207. )
  208. (if (= #CPU 3)
  209.     (
  210.     (Set #SrcImage "libs/MPImage.library.040")
  211.     (Set #SrcRender "MPRender.040")
  212.     (Set #Spatch 1)
  213.     (Set #ImagePatch "libs/MPImage.library.881")
  214.     (Set #RenderPatch "MPRender.881")
  215.     )
  216. )
  217. (if (= #CPU 2)
  218.     (
  219.     (Set #SrcImage "libs/MPImage.library.881")
  220.     (Set #SrcRender "MPRender.881")
  221.     (Set #Spatch 0)
  222.     )
  223. )
  224. (if (= #CPU 1)
  225.     (
  226.     (Set #SrcImage "libs/MPImage.library.020")
  227.     (Set #SrcRender "MPRender.020")
  228.     (Set #Spatch 1)
  229.     (Set #ImagePatch "libs/MPImage.library.000")
  230.     (Set #RenderPatch "MPRender.000")
  231.     )
  232. )
  233. (if (= #CPU 0)
  234.     (
  235.     (Set #SrcImage "libs/MPImage.library.000")
  236.     (Set #SrcRender "MPRender.000")
  237.     (Set #Spatch 0)
  238.     )
  239. )
  240. (Set #SrcRenderI (cat #SrcRender ".inf"))
  241. (Set #DestRender "MPRender")
  242. (Set #DestRenderI    (cat #DestRender ".info"))
  243. (Set #SrcGui "libs/MPGui.library")
  244. (Set #DestGui "MPGui.library")
  245. (Set #DestImage "MPImage.library")
  246. (Set #Temp "t:MPMorph.temp")
  247.  
  248. (complete 6)
  249.  
  250. (if (NOT #InPlace)
  251.     (Set #CopyGui
  252.         (askbool
  253.             (prompt "Copy GUI files?\n\n"
  254.                     "Select 'Yes' to copy the GUI files. "
  255.                     "These files may then be changed to allow you to configure the user interface. "
  256.                     "Select 'No' if you do not wish to change the interface.")
  257.             (help @askbool-help)
  258.             (default 0)
  259.         )
  260.     )
  261. )
  262.  
  263. (complete 7)
  264.  
  265. (if (NOT #InPlace)
  266.     (Set #CopyTut
  267.         (askbool
  268.             (prompt "Copy Tutorial files?\n\n"
  269.                     "A short tutorial and some image files are included. "
  270.                     "Select 'Yes' to copy the Tutorial files. "
  271.                     "Select 'No' if you do not wish to install the Tutorial.")
  272.             (help @askbool-help)
  273.             (default 1)
  274.         )
  275.     )
  276. )
  277.  
  278. (complete 8)
  279.  
  280. (if (NOT #InPlace)
  281.     (Set #CopyDoc
  282.         (askbool
  283.             (prompt "Copy Programmer files?\n\n"
  284.                     "Programmer docs and includes are included for MPGui.library and MPImage.library. "
  285.                     "Select 'Yes' to copy the docs/includes files. "
  286.                     "Select 'No' if you do not wish to install the docs/includes.")
  287.             (help @askbool-help)
  288.             (default 0)
  289.         )
  290.     )
  291. )
  292.  
  293. (complete 9)
  294.  
  295. (Set #HasBrowser
  296.     (askbool
  297.         (prompt "Do you have a Web Browser?\n\n"
  298.                 "A Web Browser can be used to view the HTML docs.")
  299.         (help @askbool-help)
  300.         (default 1)
  301.     )
  302. )
  303.  
  304. (complete 10)
  305.  
  306. (if (AND (NOT #InPlace) #HasBrowser)
  307.     (Set #CopyHTML
  308.         (askbool
  309.             (prompt "Copy .html files?\n\n"
  310.                     "Full Documentation is also included in .html format. "
  311.                     "You will need a browser to read these files. "
  312.                     "Select 'Yes' to copy the .html files. "
  313.                     "Select 'No' if you do not wish to install the .html files.")
  314.             (help @askbool-help)
  315.             (default 1)
  316.         )
  317.     )
  318.     (Set #CopyHTML 0)
  319. )
  320.  
  321. (complete 11)
  322.  
  323. (if (AND #HasBrowser (OR #InPlace #CopyHTML))
  324.     (set #Browser
  325.         (askfile
  326.             (prompt "Where is your Browser?\n"
  327.                     "The exact location and name of your Browser is required "
  328.                     "to enable a script to be set up to view the .html documentation.")
  329.             (help @askfile-help)
  330.             (default "")
  331.         )
  332.     )
  333. )
  334.  
  335. (complete 12)
  336.  
  337. ; Create destination directory
  338. (if (NOT #InPlace)
  339.     (makedir
  340.         #DestDir 
  341.         (infos)
  342.     )
  343. )
  344.  
  345. (complete 13)
  346.  
  347. (if
  348.     (askbool
  349.         (prompt "Do you have djpeg and cjpeg?\n\n"
  350.                 "Select 'Yes' if you have cjpeg and djpeg and you wish to "
  351.                 "use them to load and save jpeg files.")
  352.         (help @askbool-help)
  353.           (default 0)
  354.     )
  355.     (
  356.         (makedir
  357.             "ENV:MPImage"
  358.         )
  359.         (makedir
  360.             "ENVARC:MPImage"
  361.         )
  362.         (set #cjpeg
  363.             (askstring
  364.                 (prompt "Enter your command to run cjpeg\n\n"
  365.                         '"%s" should be used to in place of the input and '
  366.                         "output files")
  367.                 (help @askstring-help)
  368.                 (default 'cjpeg "%s" >"%s"')
  369.             )
  370.         )
  371.         (textfile
  372.             (dest "ENV:MPImage/cjpeg")
  373.             (append #cjpeg)
  374.         )
  375.         (textfile
  376.             (dest "ENVARC:MPImage/cjpeg")
  377.             (append #cjpeg)
  378.         )
  379.         (set #djpeg
  380.             (askstring
  381.                 (prompt "Enter your command to run djpeg\n\n"
  382.                         '"%s" should be used to in place of the input and '
  383.                         "output files")
  384.                 (help @askstring-help)
  385.                 (default 'djpeg "%s" >"%s"')
  386.             )
  387.         )
  388.         (textfile
  389.             (dest "ENV:MPImage/djpeg")
  390.             (append #djpeg)
  391.         )
  392.         (textfile
  393.             (dest "ENVARC:MPImage/djpeg")
  394.             (append #djpeg)
  395.         )
  396.     )
  397. )
  398.  
  399. (complete 14)
  400.  
  401. (if
  402.     (askbool
  403.         (prompt "Do you have pngtopnm and pnmtopng?\n\n"
  404.                 "Select 'Yes' if you have pngtopnm and pnmtopng and you wish to "
  405.                 "use them to load and save PNG files.")
  406.         (help @askbool-help)
  407.           (default 0)
  408.     )
  409.     (
  410.         (makedir
  411.             "ENV:MPImage"
  412.         )
  413.         (makedir
  414.             "ENVARC:MPImage"
  415.         )
  416.         (set #pnmtopng
  417.             (askstring
  418.                 (prompt "Enter your command to run pnmtopng\n\n"
  419.                         '"%s" should be used to in place of the input and '
  420.                         "output files")
  421.                 (help @askstring-help)
  422.                 (default 'pnmtopng "%s" >"%s"')
  423.             )
  424.         )
  425.         (textfile
  426.             (dest "ENV:MPImage/pnmtopng")
  427.             (append #pnmtopng)
  428.         )
  429.         (textfile
  430.             (dest "ENVARC:MPImage/pnmtopng")
  431.             (append #pnmtopng)
  432.         )
  433.         (set #pngtopnm
  434.             (askstring
  435.                 (prompt "Enter your command to run pngtopnm\n\n"
  436.                         '"%s" should be used to in place of the input and '
  437.                         "output files")
  438.                 (help @askstring-help)
  439.                 (default 'pngtopnm "%s" >"%s"')
  440.             )
  441.         )
  442.         (textfile
  443.             (dest "ENV:MPImage/pngtopnm")
  444.             (append #pngtopnm)
  445.         )
  446.         (textfile
  447.             (dest "ENVARC:MPImage/pngtopnm")
  448.             (append #pngtopnm)
  449.         )
  450.     )
  451. )
  452.  
  453. (complete 20)
  454.  
  455. ; Copy for in place installation
  456. (if #InPlace
  457.     (
  458.     (if #Spatch
  459.         (run
  460.             (cat "spatch -o" #DestRender " -p" #SrcRender ".pch " #RenderPatch)
  461.         )
  462.         (copyfiles
  463.             (source #SrcRender)
  464.             (dest #DestDir)
  465.             (newname #DestRender)
  466.         )
  467.     )
  468.     (copyfiles
  469.         (source #SrcRenderI)
  470.         (dest #DestDir)
  471.         (newname #DestRenderI)
  472.     )
  473.     (if #Spatch
  474.         (
  475.             (run
  476.                 (cat "spatch -o" #Temp " -p" #SrcImage ".pch " #ImagePatch)
  477.             )
  478.             (copylib
  479.                 (source #Temp)
  480.                 (dest #LibDir)
  481.                 (newname #DestImage)
  482.             )
  483.             (delete #temp)
  484.         )
  485.         (copylib
  486.             (source #SrcImage)
  487.             (dest #LibDir)
  488.             (newname #DestImage)
  489.         )
  490.     )
  491.     (copylib
  492.         (source #SrcGui)
  493.         (dest #LibDir)
  494.         (newname #DestGui)
  495.     )
  496.     )
  497. )
  498.  
  499.  
  500. ; Copy and rename for new drawer, delete old versions if present
  501. (if (NOT #InPlace)
  502.     (copyfiles
  503.         (prompt "Copying Non CPU specific files")
  504.           (help @copyfiles-help)
  505.         (source "")
  506.         (dest #DestDir)
  507.         (choices "MPMorph" "EditPrefs" "MPImage" "MPMorph-prefs" "MPRender-prefs"
  508.                     "RunMPGui" "ConvertMPImage" "EdgePoints" "RunMPIndex" 
  509.                     "Docs.Index"
  510.                     "MPMorph-rexx" "MPRender-rexx" "EditPrefs-rexx"
  511.                     "MPMorph.guide" "MPImage.guide"
  512.                     "MPRender.guide" "RunMPIndex.guide" "EdgePoints.guide"
  513.                     "Preview.guide" "EditPrefs.guide" "Tutorial.guide"
  514.                     "MPGui.guide" "Readme.unix")
  515.         (infos)
  516.         (confirm)
  517.     )
  518. )
  519.  
  520. (complete 30)
  521.  
  522. ; Copy for new drawer
  523. (if (NOT #InPlace)
  524.     (
  525.         (if #Spatch
  526.             (
  527.                 (run
  528.                     (cat "spatch -o" #Temp " -p" #SrcRender ".pch " #RenderPatch)
  529.                 )
  530.                 (copyfiles
  531.                     (source #Temp)
  532.                     (dest #DestDir)
  533.                     (newname #DestRender)
  534.                 )
  535.             )
  536.             (copyfiles
  537.                 (source #SrcRender)
  538.                 (dest #DestDir)
  539.                 (newname #DestRender)
  540.             )
  541.         )
  542.         (copyfiles
  543.             (source #SrcRenderI)
  544.             (dest #DestDir)
  545.             (newname #DestRenderI)
  546.         )
  547.         (if #Spatch
  548.             (
  549.                 (run
  550.                     (cat "spatch -o" #Temp " -p" #SrcImage ".pch " #ImagePatch)
  551.                 )
  552.                 (copylib
  553.                     (source #Temp)
  554.                     (dest #LibDir)
  555.                     (newname #DestImage)
  556.                 )
  557.                 (delete #temp)
  558.             )
  559.             (copylib
  560.                 (source #SrcImage)
  561.                 (dest #LibDir)
  562.                 (newname #DestImage)
  563.             )
  564.         )
  565.         (copylib
  566.             (source #SrcGui)
  567.             (dest #LibDir)
  568.             (newname #DestGui)
  569.         )
  570.     )
  571. )
  572.  
  573. (complete 40)
  574.  
  575. (if (AND (NOT #InPlace) #CopyHTML)
  576.     (
  577.         (makedir #HTMLDir)
  578.         (complete 41)
  579.         (copyfiles
  580.             (prompt "Copying .html files")
  581.             (help @copyfiles-help)
  582.             (source "HTML")
  583.             (dest #HTMLDir)
  584.             (all)
  585.         )
  586.         (complete 47)
  587.         (copyfiles
  588.             (prompt "Copying View_HTML icon")
  589.             (help @copyfiles-help)
  590.             (source "")
  591.             (dest #DestDir)
  592.             (choices "View_HTML.info")
  593.         )
  594.         (complete 48)
  595.         (copyfiles
  596.             (prompt "Copying Main HTML file")
  597.             (help @copyfiles-help)
  598.             (source "")
  599.             (dest #DestDir)
  600.             (choices "MPMorph.html")
  601.         )
  602.     )
  603. )
  604.  
  605. (complete 49)
  606.  
  607. (set #MPhtml
  608.     (tackon #DestDir "MPMorph.html")
  609. )
  610.  
  611. (if #HasBrowser
  612.     (textfile
  613.          (dest (tackon #DestDir "View_HTML"))
  614.          (append #Browser ' "file://localhost/' #MPhtml'"')
  615.     )
  616. )
  617.  
  618. (complete 50)
  619.  
  620. (makedir "ENVARC:MPMorph")
  621.  
  622. (complete 51)
  623.  
  624. (copyfiles
  625.     (prompt "Copying Icons to ENVARC:")
  626.     (help @copyfiles-help)
  627.     (source "")
  628.     (dest "ENVARC:MPMorph")
  629.     (choices "ENV/MPMorph/def_points.info"
  630.                 "ENV/MPMorph/def_pic.info"
  631.                 "ENV/MPMorph/def_prefs.info")
  632.     (confirm)
  633. )
  634.  
  635. (complete 60)
  636.  
  637. (makedir "ENV:MPMorph")
  638.  
  639. (complete 61)
  640.  
  641. (copyfiles
  642.     (prompt "Copying Icons to ENV:")
  643.     (help @copyfiles-help)
  644.     (source "")
  645.     (dest "ENV:MPMorph")
  646.     (choices "ENV/MPMorph/def_points.info"
  647.                 "ENV/MPMorph/def_pic.info"
  648.                 "ENV/MPMorph/def_prefs.info")
  649.     (confirm)
  650. )
  651.  
  652. ;
  653. ;(startup "MPMorph"
  654. ;    (prompt "Adding assign MPMorph: to " DestDir " in s:user-startup")
  655. ;    (help @startup-help)
  656. ;    (command "Assign MPMorph: " DestDir)
  657. ;)
  658. ;
  659. ;(makeassign "MPMorph" DestDir)
  660.  
  661. (complete 70)
  662.  
  663. (if #InPlace
  664.     (
  665.         (complete 100)
  666.         (exit)
  667.     )
  668. )
  669.  
  670. (makedir
  671.     #RexxDir
  672. )
  673.  
  674. (complete 75)
  675.  
  676. (copyfiles
  677.     (prompt "Copying example Rexx scripts")
  678.     (help @copyfiles-help)
  679.     (source "Rexx")
  680.     (dest #RexxDir)
  681.     (all)
  682.     (confirm)
  683. )
  684.  
  685. (complete 80)
  686.  
  687. (if #CopyGui
  688.     (
  689.         (makedir #CursorDir)
  690.         (copyfiles
  691.             (prompt "Copying Pointer files")
  692.             (help @copyfiles-help)
  693.             (source "Cursor")
  694.             (dest #CursorDir)
  695.             (all)
  696.             (confirm)
  697.         )
  698.         (complete 55)
  699.         (makedir #BrushDir)
  700.         (copyfiles
  701.             (prompt "Copying Gadget files")
  702.             (help @copyfiles-help)
  703.             (source "Brush")
  704.             (dest #BrushDir)
  705.             (all)
  706.             (confirm)
  707.         )
  708.     )
  709. )
  710.  
  711. (complete 85)
  712.  
  713. (if #CopyTut
  714.     (
  715.         (makedir #TutDir)
  716.         (copyfiles
  717.             (prompt "Copying Tutorial files")
  718.             (help @copyfiles-help)
  719.             (source "Tutorial")
  720.             (dest #TutDir)
  721.             (all)
  722.             (confirm)
  723.         )
  724.     )
  725. )
  726.  
  727. (complete 90)
  728.  
  729. (copyfiles
  730.     (prompt "Copying gui scripts")
  731.     (help @copyfiles-help)
  732.     (source "Gui")
  733.     (dest #GuiDir)
  734.     (all)
  735. )
  736.  
  737. (complete 95)
  738.  
  739. (if #CopyDoc
  740.     (
  741.         (makedir #DocsDir)
  742.         (copyfiles
  743.             (prompt "Copying Docs")
  744.             (help @copyfiles-help)
  745.             (source "Docs")
  746.             (dest #DocsDir)
  747.             (all)
  748.         )
  749.         (makedir #IncludeDir)
  750.         (copyfiles
  751.             (prompt "Copying Includes")
  752.             (help @copyfiles-help)
  753.             (source "Include")
  754.             (dest #IncludeDir)
  755.             (all)
  756.         )
  757.     )
  758. )
  759.  
  760. (complete 100)
  761.